from time import sleep

from selenium.webdriver.common.by import By

from seleniumtest_base.base.base_page import BasePage


class LoginPage51Job():
    #页面的元素
    username_loc = (By.LINK_TEXT,"密码登录")
    username_loc1 = (By.ID,"loginname")
    password_loc1 = (By.ID,"password")
    check_loc = (By.ID,"isread_em")
    submit = (By.ID,"login_btn_withPwd")
    my_update = (By.XPATH,"//span[@class='p_but flesh']")
    login_success = (By.XPATH,"//div[@class='btt']")




    #页面的动作
    @classmethod
    def login_job51(self,userName,password):
        # self.click(LoginPage51Job.username_loc)
        # sleep(5)
        BasePage.send_keys(LoginPage51Job.username_loc1,userName)
        sleep(3)
        BasePage.send_keys(LoginPage51Job.password_loc1,password)
        sleep(3)
        BasePage.click(LoginPage51Job.check_loc)
        sleep(3)
        BasePage.click(LoginPage51Job.submit)


    #断言
    @classmethod
    def get_accept_result(cls):
        return BasePage.get_value(LoginPage51Job.login_success)

    @classmethod
    def add_job(self):
        BasePage.click(LoginPage51Job.my_update)



